-
Notifications
You must be signed in to change notification settings - Fork 220
Add snapshot deployment example #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add snapshot deployment example #31
Conversation
Hi @okartau. Thanks for your PR. I'm waiting for a kubernetes-csi or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
README.md
Outdated
@@ -14,7 +14,7 @@ The easiest way to test the Hostpath driver is to run `deploy/deploy-hostpath.sh | |||
$ sh deploy/deploy-hostpath.sh | |||
``` | |||
|
|||
You should see an output similar to the following printed on the terminal showing the application of rbac rules and the result of deploying the hostpath driver, external privisioner and external attacher components: | |||
You should see an output similar to the following printed on the terminal showing the application of rbac rules and the result of deploying the hostpath driver, external privisioner, external attacher and snapshotter components: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chance for a drive-by spelling fix:
s/privisioner/provisioner/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, those 4 spelling errors sting my eye every time, but there is #2 to fix those and I did not want to step on toes of another ongoing change. I can sure fix in current PR if so desired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include the fix. Otherwise we just end up with merge conflicts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, makes sense, as this PR makes massive changes anyway. And I proposed few of #2 fixes there, so I hope its not that intrusive. Will change and re-push.
BTW, while we discuss spell etc minor issues, I want to propose: lets get rid of explicit shell call in deploy script start cmd. As the script has x-bits set, it can be started without specifying shell explicitly, and I dont see extra value from explicit sh, is there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I included all fixes of #2 now, plus removed explicit sh in deploy cmd, force-pushed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets get rid of explicit shell call in deploy script start cmd
You mean #!/usr/bin/env bash
?
As the script has x-bits set, it can be started without specifying shell explicitly,
Leave out the shebang line entirely? I doubt that this is POSIX-compliant. For example, does it work because the shell itself then reads the input or is it the Linux kernel which falls back to running in a shell? A quick test (create executable file with sleep 120
, invoke in script in dash and bash, look at /proc/*/maps
of the script) shows that it is a feature of the shell: the script then always runs in the same shell as the one it was invoked in - if the shell supports that.
and I dont see extra value from explicit sh, is there?
Last but not least, it does matter. The script uses bash features (set -o pipefail
) and therefore bash has to be set explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plus removed explicit sh in deploy cmd
I'm not seeing that in the latest changes. Are you sure you force-pushed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not clear enough in my comments. I did not mean deploy script contents, but how it's activation is written in README (where user typically copies commands from).
Was: sh deploy/deploy-hostpath.sh
I changed to: deploy/deploy-hostpath.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, absolutely. Invoking it in sh
(which could be dash
) is just plain wrong.
@@ -51,7 +52,7 @@ The [livenessprobe side-container](https://github.com/kubernetes-csi/livenesspro | |||
|
|||
## Run example application and validate | |||
|
|||
Next, validate the deployment. First, ensure all expected pods are running properly including the external attacher, provisioner, and the actual hostpath driver plugin: | |||
Next, validate the deployment. First, ensure all expected pods are running properly including the external attacher, provisioner, snapshotter and the actual hostpath driver plugin: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following output probably also needs to be updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, it was updated with one of previous PRs (added snapshotter pod). In current PR I noticed the list in text lacks the snapshotter
README.md
Outdated
@@ -188,6 +189,141 @@ Events: <none> | |||
``` | |||
|
|||
|
|||
## Snapshot support | |||
|
|||
Since volume snapshot is an alpha feature in Kubernetes v1.12 and v1.13, you need to enable feature gate called `VolumeSnapshotDataSource` in the Kubernetes API server binary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xing-yang it's also alpha in 1.14, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also needs to be enabled in kube-controller-manager.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and yes, alpha in 1.14)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add v1.14
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is good wording to mention VolumeSnapshotDataSource then?
I verified deployment in 4xVM cluster that is part of pmem-csi. There I got VolumeSnapshotDataSource added to cluster setup using config file given to "kubeadm init", so in practice I think one does not "enable gate in binary" as current sentence is, but adds gating flag in some config file or init step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just saying "you need to enable the VolumeSnapshotSource
feature gate in Kubernetes" is good enough. The actual mechanism to enable them depends on what deployment method is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also regarding the alpha versions, maybe just saying "starting in Kubernetes v1.12" is good enough. Then we don't have to keep on updating the the example every Kubernetes release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushed new state with changes discussed here in recent comments
cfd6397
to
13e1067
Compare
13e1067
to
74db762
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Migrated the snapshot example from docs/example to here, with minor updates and cleanup. Corrected misspelled snpshot in deploy file name.
74db762
to
3180e18
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
Just one minor wording nit that can be done in a followup
@@ -188,6 +189,143 @@ Events: <none> | |||
``` | |||
|
|||
|
|||
## Snapshot support | |||
|
|||
Since volume snapshot is an alpha feature starting in Kubernetes v1.12, you need to enable feature gate called `VolumeSnapshotDataSource` in the Kubernetes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: reword as
"Volume snapshot is an alpha feature introduced in Kubernetes v1.12. The Kubernetes feature gate VolumeSnapshotDataSource
must be enabled."
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: msau42, okartau The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold The script has a race condition: the snapshot class gets created without waiting for the snapshotter to create the corresponding CRD. I suggest we merge this as part of PR #29 with a fix. |
Oops, too late. Let's follow up with the fix in PR #29 then. |
Migrated the snapshot example from docs/example to here,
with minor updates and cleanup.
Corrected misspelled snpshot in deploy file name.